/*
 * @Description: 
 * @Version: 2.0
 * @Autor: ftt
 * @Date: 2022-03-23 15:56:41
 * @LastEditors: TT
 * @LastEditTime: 2022-12-07 21:03:26
 */
import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'hzy_normal_getx_list_controller.dart';
import 'hzy_normal_getx_view.dart';
import 'package:ttcomment/ttcomment.dart';

abstract class NormalGetxListView<T extends NormalGetxListController>
    extends NormaGetxView<T> with AbstracRefreshWidget {
  NormalGetxListView({Key? key}) : super(key: key);

  @override
  Widget createBody(BuildContext context) {
    return createRefreshWidget(context);
  }

  @override
  Widget createRefreshWidget(BuildContext context) {
    return EasyRefresh(
      key: key,
      controller: controller.refreshController ?? EasyRefreshController(),
      onRefresh: () async {
        controller.configRefresh();
      },
      onLoad: () async {
        controller.configLoading();
      },
      child: createListView(context),
      header: createHeader(),
      footer: createFooter(),
    );
  }

  Header? createHeader() {
    return null;
  }

  Footer? createFooter() {
    return null;
  }
}
